package bo.zhao.action.observer;

import bo.zhao.action.observer.observer.Observer1;
import bo.zhao.action.observer.observer.Observer2;
import bo.zhao.action.observer.subject.MySubject;
import bo.zhao.action.observer.subject.Subject;

public class ObserverTest {

	
	public static void main(String[] args) {
		
		Subject sub = new MySubject();
		
		//添加观察者
		sub.add(new Observer1());
		sub.add(new Observer2());
		
		//执行操作时，通知观察者
		sub.operation();
	}

}
